bitkeeper revision 1.555 (3fa7a5e43euoBbbuurbkHsps0sbRqQ)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 4 Nov 2003 13:13:08 +0000 (13:13 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 4 Nov 2003 13:13:08 +0000 (13:13 +0000)
init.c, setup.c, network.c, xl_block.c:
  Small cleanups for previous checkin.

xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c
xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c
xenolinux-2.4.22-sparse/arch/xeno/mm/init.c

index c3cf866de5708af1dea1b99a7d1db5f9a21e978f..56dab7e3f3304b767b2a1542b3fd07e565d632b3 100644 (file)
@@ -490,6 +490,23 @@ void do_xlblk_request(request_queue_t *rq)
 }
 
 
+static void kick_pending_request_queues(void)
+{
+    /* We kick pending request queues if the ring is reasonably empty. */
+    if ( (nr_pending != 0) && 
+         (((req_prod - resp_cons) & (BLK_RING_SIZE - 1)) < 
+          (BLK_RING_SIZE >> 1)) )
+    {
+        /* Attempt to drain the queue, but bail if the ring becomes full. */
+        while ( nr_pending != 0 )
+        {
+            do_xlblk_request(pending_queues[--nr_pending]);
+            if ( RING_PLUGGED ) break;
+        }
+    }
+}
+
+
 static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
 {
     int i; 
@@ -538,18 +555,7 @@ static void xlblk_response_int(int irq, void *dev_id, struct pt_regs *ptregs)
     
     resp_cons = i;
 
-    /* We kick pending request queues if the ring is reasonably empty. */
-    if ( (nr_pending != 0) && 
-         (((req_prod - resp_cons) & (BLK_RING_SIZE - 1)) < 
-          (BLK_RING_SIZE >> 1)) )
-    {
-        /* Attempt to drain the queue, but bail if the ring becomes full. */
-        while ( nr_pending != 0 )
-        {
-            do_xlblk_request(pending_queues[--nr_pending]);
-            if ( RING_PLUGGED ) break;
-        }
-    }
+    kick_pending_request_queues();
 
     spin_unlock_irqrestore(&io_request_lock, flags);
 }
@@ -692,4 +698,7 @@ void blkdev_suspend(void)
 void blkdev_resume(void)
 {
     reset_xlblk_interface();
+    spin_lock_irq(&io_request_lock);
+    kick_pending_request_queues();
+    spin_unlock_irq(&io_request_lock);
 }
index 00af8be83482a66d01caeb7c9dbaf34cd06bb954..748571a98f0c5e684e70fb1350a5534891c12723 100644 (file)
@@ -321,7 +321,9 @@ static inline void _network_interrupt(struct net_device *dev)
 
         if ( rx->status != RING_STATUS_OK )
         {
-            printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status);
+            /* Gate this error. We get a (valid) slew of them on suspend. */
+            if ( np->state == STATE_ACTIVE )
+                printk(KERN_ALERT "bad buffer on RX ring!(%d)\n", rx->status);
             dev_kfree_skb_any(skb);
             continue;
         }
index 6fdbf9d165a534fd752b112779e5a35a847d8b8d..9c70c61a71d4677583b37ac3dbfa5c77d399c1d4 100644 (file)
@@ -1080,12 +1080,14 @@ static void stop_task(void *unused)
 
     __cli();
 
+    HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     clear_fixmap(FIX_SHARED_INFO);
 
     HYPERVISOR_stop();
 
     set_fixmap(FIX_SHARED_INFO, start_info.shared_info);
     HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
+    memset(empty_zero_page, 0, PAGE_SIZE);
 
     __sti();
 
index ef77f9629bfbce6fd03c6b67d39dd9c071a26d58..883cd03b37dd90ba623644a954826ac18a606aff 100644 (file)
@@ -113,8 +113,10 @@ static inline void set_pte_phys (unsigned long vaddr,
     }
     pte = pte_offset(pmd, vaddr);
 
+#if 0 /* Not in Xen, since this breaks clear_fixmap. */
     if (pte_val(*pte))
         pte_ERROR(*pte);
+#endif
 
     /* We queue directly, avoiding hidden phys->machine translation. */
     queue_l1_entry_update(pte, phys | pgprot_val(prot));